export interface TooltipParams {
  marker: string
  seriesName: string
  data: number
  name: string
}

export interface ProcessOption {
  title: {
    text?: string
    left?: string
    right?: string
  }[]
  tooltip: {
    trigger: string
    formatter: (query: TooltipParams[]) => string
  }
  xAxis: {
    data: string[]
  }
  yAxis: object
  series: {
    name: string
    data: number[]
    type: string
    smooth: boolean
  }[]
}

export interface NameValue {
  name: string
  length?: number
  value: number
}

export interface BattleInfoDetail {
  time: string
  action: string
  skill: string
  target: string
  count: number
}

export interface LineData {
  // title: string
  // xSeries: string[]
  // ySeries: string[]
  xAxisData: string[]
  yAxisData: string[]
}
export interface LineDataDetail {
  name: string
  data: number[]
  type: string
  smooth: boolean
}
// multiLine
export interface MultiLineData {
  xAxisData: string[]
  yAxisData: LineDataDetail[]
}

export type ProcessedText = {
  defeatLines?: string[]
  deathLines?: string[]
  allBattleInfo?: BattleInfoDetail[]
  // wholeEnemy?: string[]
  wholeUsers?: Map<string, string>
  userName?: string | null
  allUserLines?: string[]
  allEffectData?: BattleInfoDetail[]
}

export type SummaryInfo = {
  encounter: number
  output: number
  receive: number
  death: number
  kill: number
}

export type TargetInfo = {
  name: string
  // 职业名字
  role: string
  // 承受伤害
  receive: number
  // 输出伤害
  output: number
}

export interface BattleData {
  userName?: string | null
  smoothlineOption: MultiLineData | null
  skillAgg: MultiLineData | null
  roleStat: NameValue[]
  buffAgg: MultiLineData | null
  inPieOption: NameValue[]
  outPieOption: NameValue[]
  inSkillOption: NameValue[]
  outSkillOption: NameValue[]
  headCount: MultiLineData | null
  top30Count: {
    out: BattleInfoDetail[]
    received: BattleInfoDetail[]
  } | null
  summary: SummaryInfo
  targets: TargetInfo[]
  kill: NameValue[]
  death: NameValue[]
}
